package com.gengzp.system.service.impl;

import com.gengzp.common.enums.PermissionEnum;
import com.gengzp.common.model.log.resp.SearchOperationLogCountResp;
import com.gengzp.common.model.permission.resp.SearchPermissionCountResp;
import com.gengzp.common.model.serviceGovernance.resp.SearchServiceGovernanceCountResp;
import com.gengzp.common.model.user.resp.SearchSysUserCountResp;
import com.gengzp.system.facade.ServiceGovernanceFacade;
import com.gengzp.system.facade.SysLogFacade;
import com.gengzp.system.facade.SysUserFacade;
import com.gengzp.system.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName DashboardServiceImpl
 * @Description 仪表板数据统计模块服务层实现
 * @Author gengzp
 * @Date 2025/10/23 20:46
 */
@Service
public class DashboardServiceImpl implements DashboardService {

    @Autowired
    private SysUserFacade sysUserFacade;

    @Autowired
    private SysLogFacade sysLogFacade;

    @Autowired
    private ServiceGovernanceFacade serviceGovernanceFacade;

    @Override
    public SearchSysUserCountResp searchSysUserCount() {
        return sysUserFacade.searchSysUserCount();
    }

    @Override
    public SearchPermissionCountResp searchPermissionCount() {
        SearchPermissionCountResp resp = new SearchPermissionCountResp();
        resp.setLimitedPermissionCount(PermissionEnum.values().length);
        return resp;
    }

    @Override
    public SearchOperationLogCountResp searchOperationLogCount() {
        return sysLogFacade.searchOperationLogCount();
    }

    @Override
    public List<SearchServiceGovernanceCountResp> searchServiceGovernanceCount() {
        return serviceGovernanceFacade.searchServiceGovernanceCount();
    }

}
